<%--
 *  File:    DistributortenderProdSelect.jsp
 *  @Author: Langerwang 
 *  Date:    2001/12/19
 *
 *  Copyright (C) 2000 - 2001 Oval Technologies, Inc.
 *  All rights reserved. 
 *
 *  This software is the confidential and proprietary information of Oval 
 *  Technologies, Inc. ("Confidential Information").  You shall not
 *  disclose such Confidential Information and shall use it only in
 *  accordance with the terms of the license agreement you entered into
 *  with Oval.
--%>


<%@ include file="/inc/SessionTimeout.inc"%>
<%@ page language="java" %>     
<%@ page import="java.util.*" %>
<%@ page import="org.apache.log4j.Category" %>

<%@ page contentType = "text/html;charset=UTF-8" %>
<%@ taglib uri="/WEB-INF/PageFlow.tld" prefix="PageFlow" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/custom.tld" prefix="custom" %>

<%
  //init param
  Category cat = Category.getInstance("jsp.DistributortenderProd");
   
  String strModuleName = "DMS";
  String strTableName = "v_distributortenderprod";
  Integer sourceorgid = new Integer(-1);
  String contextPath = request.getContextPath();
  String isView = request.getParameter("isview");
  if(isView == null && session.getAttribute("isview") != null){
  	isView = session.getAttribute("isview").toString();
  }
%>
<%@ include file="/inc/PageDefault.inc" %>

<html>
<head>
<title>DistributortenderProdSelect</title>
<PageFlow:CheckPageFlow pageName="p_distributortenderidprod"/>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../../css/<%= strLanguageCode %>/main.css" type="text/css">
<script language="JavaScript" src="../../css/<%= strLanguageCode %>/script.js"></script>
<script language="JavaScript" src="../../js/FuncLib.js"></script>
<%@ include file="/inc/SummaryDivision.inc" %>
<%

  //OvalCustomTable table = new OvalCustomTable(strLanguageCode);
  //OvalCustomColumn column = new OvalCustomColumn(strLanguageCode);


  Vector visitprocessprodinfo = (Vector)pageContext.getAttribute("visitprocessprodinfo");
  if(visitprocessprodinfo == null)
  {
    visitprocessprodinfo = new Vector();
  }

    HashMap orgInfo = (HashMap)pageContext.getAttribute("orginfo");
	if (orgInfo == null) orgInfo = new HashMap();

    boolean ispharmacy = false;

    Integer globalPCCode =  (Integer)orgInfo.get("globalpccode");

	
	Integer zmylcustomtype =  (Integer)orgInfo.get("zmylcustomtype");


	if(globalPCCode == null) globalPCCode = new Integer("-1");
    if(zmylcustomtype == null) globalPCCode = new Integer("-1");
	/*if(new Integer(114).equals(globalPCCode)&&new Integer(10).equals(zmylcustomtype)){
		 ispharmacy=true;
	}*/
	
	Integer distributortenderid =  (Integer)pageContext.getAttribute("distributortenderid");
	
	Integer flag =  (Integer)pageContext.getAttribute("flag");
	

%>
<script>
function clickRegion(code,name,id)
{
  document.regionselectform.prodcode.value = code;
  document.regionselectform.prdn.value = name;
  document.regionselectform.prodid.value = id;
  
  
}
function page_summary(actionvalue,orderbyname)
{
  var editform = summaryPrepare(regionselectform,actionvalue,orderbyname);
  editform.action = "DistributortenderProdSelect.jsp?<%= OvalTools.randomURL() %>";
  editform.target = "_self";
  isRunning = true;
  editform.submit();  
}

function setParentValue()
{
    opener.setProd(document.regionselectform.prodcode.value,document.regionselectform.prdn.value,document.regionselectform.prodid.value);
  	window.close();
}

</script>

</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%" cellspacing="0" cellpadding="0" height="100%">
<form name="regionselectform" method="post">
    <input type="hidden" name="pagename" value="p_distributortenderidprod">
    <input type="hidden" name="actionname">   
    <input type="hidden" name="languagecode" value="<%=JspHelper.filterNull( session.getAttribute("languagecode") )%>">
    <input type="hidden" name="flag" value="1">                 
    <tr> 
      <td valign="top"> 
        <table width="100%" cellspacing="0" cellpadding="0">
          <tr> 
            <td class="summary_top"></td>
          </tr>
        </table>
        <table width="100%" cellspacing="0" cellpadding="0">
          <%@ include file="/inc/SummarySearch.inc" %>
          <tr> 
            <td height="5" colspan="2" class="summary_top"></td>
          </tr>
        </table>
        
      <table width="100%" border="1" cellpadding="0" bordercolorlight="#999999" bordercolordark="#FFFFFF" cellspacing="0" align="center">
          <tr> 
    <tr> 
      <td width="5%" class="deepblue-left">&nbsp;</td>
      <td class="deepblue-left" width="60" nowrap><%= label.getLabelName("L_ProductCode") %></td>
      <td class="deepblue-left"><%= label.getLabelName("L_ProductName") %></td>
    </tr>
     <%
        int i = 0;
        String strIsChecked = new String("Checked");
        String strClassType = new String();   
        String strRegionCode = "";     
        String strRegionName = "";
        Integer nRegionid = new Integer("-1");
     %>
     <logic:iterate id="reasoninfo" collection="<%= visitprocessprodinfo %>">                     
     <%
     HashMap regionMap = (HashMap)pageContext.getAttribute("reasoninfo");
       if(i%2 == 1)
       {
         strClassType = "td-listrom";
       }else{                    
         strClassType = "";
       }
       if(i != 0)
       {          
         strIsChecked = "";
       }
       else
       {
         strRegionCode = (String)(regionMap.get("prodcode"));         
         strRegionName = (String)(regionMap.get("prdn"));
         nRegionid = (Integer)(regionMap.get("prodid"));
       }  
       i++;        
     %>       
     <tr onMouseOver="this.className='tr-over'" onMouseOut="this.className='<%=JspHelper.filterNull( strClassType )%>'"  onClick="javascript:radiotrue('region<%=JspHelper.filterNull( i )%>');clickRegion('<%=JspHelper.filterNull( regionMap.get("prodcode") )%>','<%=JspHelper.filterNull( regionMap.get("prdn") )%>','<%=JspHelper.filterNull( regionMap.get("prodid") )%>');" class="<%=JspHelper.filterNull( strClassType )%>">
      <td class="<%=JspHelper.filterNull( strClassType )%>"> 
        <input id=region<%=JspHelper.filterNull( i )%> type="radio" name="selectRegion" value="<%=JspHelper.filterNull( regionMap.get("prodid") )%>" <%=JspHelper.filterNull( strIsChecked )%> class="normalradio">
      </td>
      <td class="<%=JspHelper.filterNull( strClassType )%>">&nbsp;<%=JspHelper.filterNull( regionMap.get("prodcode") )%></td>
      <td class="<%=JspHelper.filterNull( strClassType )%>">&nbsp;<%=JspHelper.filterNull( regionMap.get("prdn") )%>
      </td>
    </tr>
    </logic:iterate> 
    <input type="hidden" name="prodcode" value="<%=JspHelper.filterNull( strRegionCode )%>">    
    <input type="hidden" name="prdn" value="<%=JspHelper.filterNull( strRegionName )%>">
    <input type="hidden" name="prodid" value="<%=JspHelper.filterNull( nRegionid )%>">
                    <% //--------------------------------------  flipping page --%>
    		<%@ include file="/inc/SummaryActionPop.inc" %>
        
      </table>
        <table width="100%" cellspacing="0" cellpadding="0">
          <tr> 
            <td class="summary_top"></td>
          </tr>
          <tr> 
            
    <td class="td_center"><a onclick="setParentValue()"><custom:button type="1" label="L_Finish" imgsrc="finish.gif" border="0" style="width:60"/></a></td>
          </tr>
        </table>
      </td>
    </tr>
            </form>

</table>
</body>
</html>


